package com.shouhe.mysap.util;

import com.shouhe.mysap.common.MySapResult;

/**
 * @author 守鹤
 * @date 2020/6/1 22:44
 */
public class PrintUtil {

    public static MySapResult err(String oper,String msg){
        System.err.println(oper+"失败"+msg);
        return MySapResult.fail(oper+"失败"+msg);
    }

    public static MySapResult succ(String oper,String content){
        System.out.println(oper+"成功"+content);
        return MySapResult.success(oper+"删除成功"+content);
    }

    public static MySapResult succOrErr(Boolean flag,String oper,String content){
        if(flag){
            return succ(oper,content);
        }
        return err(oper,content);
    }


}
